FROM node:18.19.1 as build

WORKDIR /app

COPY . .

RUN npm i -g pnpm --registry=https://registry.npmmirror.com

RUN pnpm install --registry=https://registry.npmmirror.com

RUN npm run build-only

FROM nginx:1.25.4

COPY --from=build /app/dist /usr/share/nginx/html/pc
COPY --from=build /app/nginx.conf /etc/nginx/nginx.conf
